home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Microsoft Plateform / Visual Basic 5.0 / Msvb50.ace / msvb50 / MSVB50 / VB / SAMPLES / VISDATA / VDMDI.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-01-07  |  46.1 KB  |  1,412 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.1#0"; "ComDlg32.OCX"
  3. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.1#0"; "comctl32.ocx"
  4. Begin VB.MDIForm frmMDI 
  5.    BackColor       =   &H8000000C&
  6.    Caption         =   "VisData"
  7.    ClientHeight    =   6780
  8.    ClientLeft      =   4110
  9.    ClientTop       =   2625
  10.    ClientWidth     =   10005
  11.    HelpContextID   =   2016116
  12.    Icon            =   "VDMDI.frx":0000
  13.    LinkTopic       =   "MDIForm1"
  14.    LockControls    =   -1  'True
  15.    Begin ComctlLib.Toolbar tlbToolBar 
  16.       Align           =   1  'Align Top
  17.       Height          =   420
  18.       Left            =   0
  19.       TabIndex        =   1
  20.       Top             =   0
  21.       Width           =   10005
  22.       _ExtentX        =   17648
  23.       _ExtentY        =   741
  24.       ButtonWidth     =   609
  25.       ButtonHeight    =   582
  26.       AllowCustomize  =   0   'False
  27.       Wrappable       =   0   'False
  28.       Appearance      =   1
  29.       HelpContextID   =   65278
  30.       HelpFile        =   $"VDMDI.frx":014A
  31.       ImageList       =   "imlToolbarPics"
  32.       _Version        =   327680
  33.       BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7} 
  34.          NumButtons      =   12
  35.          BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  36.             Key             =   "Table"
  37.             Object.ToolTipText     =   "Table type Recordset"
  38.             Object.Tag             =   ""
  39.             ImageIndex      =   1
  40.             Style           =   2
  41.          EndProperty
  42.          BeginProperty Button2 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  43.             Key             =   "Dynaset"
  44.             Object.ToolTipText     =   "Dynaset type Recordset"
  45.             Object.Tag             =   ""
  46.             ImageIndex      =   2
  47.             Style           =   2
  48.          EndProperty
  49.          BeginProperty Button3 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  50.             Key             =   "Snapshot"
  51.             Object.ToolTipText     =   "Snapshot type Recordset"
  52.             Object.Tag             =   ""
  53.             ImageIndex      =   3
  54.             Style           =   2
  55.          EndProperty
  56.          BeginProperty Button4 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  57.             Object.Visible         =   0   'False
  58.             Key             =   "PassThrough"
  59.             Object.ToolTipText     =   "Passthrough type Recordset"
  60.             Object.Tag             =   ""
  61.             ImageIndex      =   4
  62.             Style           =   2
  63.          EndProperty
  64.          BeginProperty Button5 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  65.             Key             =   ""
  66.             Object.Tag             =   ""
  67.             Style           =   3
  68.             Value           =   1
  69.             MixedState      =   -1  'True
  70.          EndProperty
  71.          BeginProperty Button6 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  72.             Key             =   "DataControl"
  73.             Object.ToolTipText     =   "Use Data Control on New Form"
  74.             Object.Tag             =   ""
  75.             ImageIndex      =   5
  76.             Style           =   2
  77.          EndProperty
  78.          BeginProperty Button7 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  79.             Key             =   "NoDataControl"
  80.             Object.ToolTipText     =   "Don't Use Data Control on New Form"
  81.             Object.Tag             =   ""
  82.             ImageIndex      =   6
  83.             Style           =   2
  84.          EndProperty
  85.          BeginProperty Button8 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  86.             Key             =   "DBGrid"
  87.             Object.ToolTipText     =   "Use DBGrid Control on New Form"
  88.             Object.Tag             =   ""
  89.             ImageIndex      =   7
  90.             Style           =   2
  91.          EndProperty
  92.          BeginProperty Button9 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  93.             Key             =   ""
  94.             Object.Tag             =   ""
  95.             Style           =   3
  96.             Value           =   1
  97.             MixedState      =   -1  'True
  98.          EndProperty
  99.          BeginProperty Button10 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  100.             Enabled         =   0   'False
  101.             Key             =   "BeginTrans"
  102.             Object.ToolTipText     =   "Begin a Transaction"
  103.             Object.Tag             =   ""
  104.             ImageIndex      =   8
  105.          EndProperty
  106.          BeginProperty Button11 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  107.             Enabled         =   0   'False
  108.             Key             =   "Rollback"
  109.             Object.ToolTipText     =   "Rollback current Transaction"
  110.             Object.Tag             =   ""
  111.             ImageIndex      =   9
  112.          EndProperty
  113.          BeginProperty Button12 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  114.             Enabled         =   0   'False
  115.             Key             =   "Commit"
  116.             Object.ToolTipText     =   "Commit current Transaction"
  117.             Object.Tag             =   ""
  118.             ImageIndex      =   10
  119.          EndProperty
  120.       EndProperty
  121.       MouseIcon       =   "VDMDI.frx":014F
  122.    End
  123.    Begin VB.PictureBox Picture1 
  124.       Align           =   1  'Align Top
  125.       BorderStyle     =   0  'None
  126.       Height          =   15
  127.       Left            =   0
  128.       ScaleHeight     =   15
  129.       ScaleWidth      =   10005
  130.       TabIndex        =   2
  131.       Top             =   420
  132.       Width           =   10005
  133.    End
  134.    Begin MSComDlg.CommonDialog dlgCMD1 
  135.       Left            =   -15
  136.       Top             =   690
  137.       _ExtentX        =   847
  138.       _ExtentY        =   847
  139.       _Version        =   327680
  140.       FilterIndex     =   1144
  141.       FontSize        =   1.74012e-39
  142.    End
  143.    Begin ComctlLib.StatusBar stsStatusBar 
  144.       Align           =   2  'Align Bottom
  145.       Height          =   300
  146.       Left            =   0
  147.       TabIndex        =   0
  148.       Top             =   6480
  149.       Width           =   10005
  150.       _ExtentX        =   17648
  151.       _ExtentY        =   529
  152.       SimpleText      =   ""
  153.       _Version        =   327680
  154.       BeginProperty Panels {0713E89E-850A-101B-AFC0-4210102A8DA7} 
  155.          NumPanels       =   2
  156.          BeginProperty Panel1 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
  157.             AutoSize        =   1
  158.             Object.Width           =   14579
  159.             Text            =   "Ready"
  160.             TextSave        =   "Ready"
  161.             Key             =   ""
  162.             Object.Tag             =   ""
  163.          EndProperty
  164.          BeginProperty Panel2 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
  165.             AutoSize        =   2
  166.             TextSave        =   ""
  167.             Key             =   ""
  168.             Object.Tag             =   ""
  169.          EndProperty
  170.       EndProperty
  171.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  172.          Name            =   "Tahoma"
  173.          Size            =   8.25
  174.          Charset         =   0
  175.          Weight          =   400
  176.          Underline       =   0   'False
  177.          Italic          =   0   'False
  178.          Strikethrough   =   0   'False
  179.       EndProperty
  180.       MouseIcon       =   "VDMDI.frx":016B
  181.    End
  182.    Begin ComctlLib.ImageList imlToolbarPics 
  183.       Left            =   495
  184.       Top             =   705
  185.       _ExtentX        =   1005
  186.       _ExtentY        =   1005
  187.       BackColor       =   -2147483634
  188.       ImageWidth      =   16
  189.       ImageHeight     =   16
  190.       MaskColor       =   -2147483644
  191.       _Version        =   327680
  192.       BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7} 
  193.          NumListImages   =   10
  194.          BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  195.             Picture         =   "VDMDI.frx":0187
  196.             Key             =   ""
  197.          EndProperty
  198.          BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  199.             Picture         =   "VDMDI.frx":04A1
  200.             Key             =   ""
  201.          EndProperty
  202.          BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  203.             Picture         =   "VDMDI.frx":07BB
  204.             Key             =   ""
  205.          EndProperty
  206.          BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  207.             Picture         =   "VDMDI.frx":0AD5
  208.             Key             =   ""
  209.          EndProperty
  210.          BeginProperty ListImage5 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  211.             Picture         =   "VDMDI.frx":0DEF
  212.             Key             =   ""
  213.          EndProperty
  214.          BeginProperty ListImage6 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  215.             Picture         =   "VDMDI.frx":1109
  216.             Key             =   ""
  217.          EndProperty
  218.          BeginProperty ListImage7 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  219.             Picture         =   "VDMDI.frx":1423
  220.             Key             =   ""
  221.          EndProperty
  222.          BeginProperty ListImage8 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  223.             Picture         =   "VDMDI.frx":173D
  224.             Key             =   ""
  225.          EndProperty
  226.          BeginProperty ListImage9 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  227.             Picture         =   "VDMDI.frx":1A57
  228.             Key             =   ""
  229.          EndProperty
  230.          BeginProperty ListImage10 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  231.             Picture         =   "VDMDI.frx":1D71
  232.             Key             =   ""
  233.          EndProperty
  234.       EndProperty
  235.    End
  236.    Begin VB.Menu mnuDatabase 
  237.       Caption         =   "&File"
  238.       HelpContextID   =   2096095
  239.       Begin VB.Menu mnuDBOpen 
  240.          Caption         =   "&Open DataBase..."
  241.          HelpContextID   =   2016062
  242.          Begin VB.Menu mnuDBOMDB 
  243.             Caption         =   "&Microsoft Access..."
  244.          End
  245.          Begin VB.Menu mnuDBOdBASE 
  246.             Caption         =   "&Dbase"
  247.             Begin VB.Menu mnuDBOdBASE5 
  248.                Caption         =   "&5.0..."
  249.             End
  250.             Begin VB.Menu mnuDBOdBASE4 
  251.                Caption         =   "I&V..."
  252.             End
  253.             Begin VB.Menu mnuDBOdBASE3 
  254.                Caption         =   "&III..."
  255.             End
  256.          End
  257.          Begin VB.Menu mnuDBOFoxPro 
  258.             Caption         =   "&FoxPro"
  259.             Begin VB.Menu mnuDBOFox30 
  260.                Caption         =   "&3.0..."
  261.             End
  262.             Begin VB.Menu mnuDBOFox26 
  263.                Caption         =   "2.&6..."
  264.             End
  265.             Begin VB.Menu mnuDBOFox25 
  266.                Caption         =   "2.&5..."
  267.             End
  268.             Begin VB.Menu mnuDBOFox20 
  269.                Caption         =   "2.&0..."
  270.             End
  271.          End
  272.          Begin VB.Menu mnuDBOParadox 
  273.             Caption         =   "&Paradox"
  274.             Begin VB.Menu mnuDBOParadox5 
  275.                Caption         =   "&5.0..."
  276.             End
  277.             Begin VB.Menu mnuDBOParadox4 
  278.                Caption         =   "&4.X..."
  279.             End
  280.             Begin VB.Menu mnuDBOParadox3 
  281.                Caption         =   "&3.X..."
  282.             End
  283.          End
  284.          Begin VB.Menu mnuDBOBtrieve 
  285.             Caption         =   "&Btrieve..."
  286.          End
  287.          Begin VB.Menu mnuDBOExcel 
  288.             Caption         =   "&Excel..."
  289.          End
  290.          Begin VB.Menu mnuDBOText 
  291.             Caption         =   "&Text Files..."
  292.          End
  293.          Begin VB.Menu mnuDBOODBC 
  294.             Caption         =   "&ODBC..."
  295.             HelpContextID   =   2016138
  296.          End
  297.       End
  298.       Begin VB.Menu mnuDBNew 
  299.          Caption         =   "&New..."
  300.          HelpContextID   =   2016083
  301.          Begin VB.Menu mnuDBNMDB 
  302.             Caption         =   "&Microsoft Access"
  303.             Begin VB.Menu mnuDBNMDB2x 
  304.                Caption         =   "Version &2.0 MDB..."
  305.             End
  306.             Begin VB.Menu mnuDBNMDB70 
  307.                Caption         =   "Version &7.0 MDB..."
  308.             End
  309.          End
  310.          Begin VB.Menu mnuDBNdBASE 
  311.             Caption         =   "&Dbase"
  312.             Begin VB.Menu mnuDBNdBASE5 
  313.                Caption         =   "&5.0..."
  314.             End
  315.             Begin VB.Menu mnuDBNdBASE4 
  316.                Caption         =   "I&V..."
  317.             End
  318.             Begin VB.Menu mnuDBNdBASE3 
  319.                Caption         =   "&III..."
  320.             End
  321.          End
  322.          Begin VB.Menu mnuDBNFoxPro 
  323.             Caption         =   "&FoxPro"
  324.             Begin VB.Menu mnuDBNFox30 
  325.                Caption         =   "&3.0..."
  326.             End
  327.             Begin VB.Menu mnuDBNFox26 
  328.                Caption         =   "2.&6..."
  329.             End
  330.             Begin VB.Menu mnuDBNFox25 
  331.                Caption         =   "2.&5..."
  332.             End
  333.             Begin VB.Menu mnuDBNFox20 
  334.                Caption         =   "2.&0..."
  335.             End
  336.          End
  337.          Begin VB.Menu mnuDBNParadox 
  338.             Caption         =   "&Paradox"
  339.             Begin VB.Menu mnuDBNParadox5 
  340.                Caption         =   "&5.0..."
  341.             End
  342.             Begin VB.Menu mnuDBNParadox4 
  343.                Caption         =   "&4.X..."
  344.             End
  345.             Begin VB.Menu mnuDBNParadox3 
  346.                Caption         =   "&3.X..."
  347.             End
  348.          End
  349.          Begin VB.Menu mnuDBNBtrieve 
  350.             Caption         =   "&Btrieve..."
  351.          End
  352.          Begin VB.Menu mnuDBNODBC 
  353.             Caption         =   "&ODBC..."
  354.          End
  355.          Begin VB.Menu mnuDBNText 
  356.             Caption         =   "&Text Files..."
  357.          End
  358.       End
  359.       Begin VB.Menu mnuDBClose 
  360.          Caption         =   "&Close"
  361.          Enabled         =   0   'False
  362.          HelpContextID   =   2016079
  363.       End
  364.       Begin VB.Menu mnuBar0 
  365.          Caption         =   "-"
  366.       End
  367.       Begin VB.Menu mnuDBImpExp 
  368.          Caption         =   "&Import/Export..."
  369.          Enabled         =   0   'False
  370.          HelpContextID   =   2016092
  371.       End
  372.       Begin VB.Menu mnuDBWorkspace 
  373.          Caption         =   "&Workspace..."
  374.          HelpContextID   =   2016080
  375.       End
  376.       Begin VB.Menu mnuDBErrors 
  377.          Caption         =   "&Errors..."
  378.          HelpContextID   =   2016081
  379.       End
  380.       Begin VB.Menu mnuBar1 
  381.          Caption         =   "-"
  382.       End
  383.       Begin VB.Menu mnuDBCompact 
  384.          Caption         =   "Co&mpact MDB..."
  385.          HelpContextID   =   2016084
  386.          Begin VB.Menu mnuDBC70MDB 
  387.             Caption         =   "&7.0 MDB..."
  388.             HelpContextID   =   2016084
  389.          End
  390.          Begin VB.Menu mnuDBC20MDB 
  391.             Caption         =   "&2.0 MDB..."
  392.             HelpContextID   =   2016084
  393.          End
  394.       End
  395.       Begin VB.Menu mnuDBRepair 
  396.          Caption         =   "&Repair MDB..."
  397.          HelpContextID   =   2016085
  398.       End
  399.       Begin VB.Menu mnuBar2 
  400.          Caption         =   "-"
  401.       End
  402.       Begin VB.Menu mnuDBMRU 
  403.          Caption         =   "&1"
  404.          HelpContextID   =   2016095
  405.          Index           =   1
  406.          Visible         =   0   'False
  407.       End
  408.       Begin VB.Menu mnuDBMRU 
  409.          Caption         =   "&2"
  410.          HelpContextID   =   2016095
  411.          Index           =   2
  412.          Visible         =   0   'False
  413.       End
  414.       Begin VB.Menu mnuDBMRU 
  415.          Caption         =   "&3"
  416.          HelpContextID   =   2016095
  417.          Index           =   3
  418.          Visible         =   0   'False
  419.       End
  420.       Begin VB.Menu mnuDBMRU 
  421.          Caption         =   "&4"
  422.          HelpContextID   =   2016095
  423.          Index           =   4
  424.          Visible         =   0   'False
  425.       End
  426.       Begin VB.Menu mnuDBMRU 
  427.          Caption         =   "&5"
  428.          HelpContextID   =   2016095
  429.          Index           =   5
  430.          Visible         =   0   'False
  431.       End
  432.       Begin VB.Menu mnuDBMRU 
  433.          Caption         =   "&6"
  434.          HelpContextID   =   2016095
  435.          Index           =   6
  436.          Visible         =   0   'False
  437.       End
  438.       Begin VB.Menu mnuDBMRU 
  439.          Caption         =   "&7"
  440.          HelpContextID   =   2016095
  441.          Index           =   7
  442.          Visible         =   0   'False
  443.       End
  444.       Begin VB.Menu mnuDBMRU 
  445.          Caption         =   "&8"
  446.          HelpContextID   =   2016095
  447.          Index           =   8
  448.          Visible         =   0   'False
  449.       End
  450.       Begin VB.Menu mnuBarMRU 
  451.          Caption         =   "-"
  452.          Visible         =   0   'False
  453.       End
  454.       Begin VB.Menu mnuDBExit 
  455.          Caption         =   "E&xit"
  456.          HelpContextID   =   2016095
  457.       End
  458.    End
  459.    Begin VB.Menu mnuUtil 
  460.       Caption         =   "&Utility"
  461.       Enabled         =   0   'False
  462.       HelpContextID   =   2096097
  463.       Begin VB.Menu mnuUQuery 
  464.          Caption         =   "&Query Builder..."
  465.          HelpContextID   =   2016115
  466.       End
  467.       Begin VB.Menu mnuUDataFormDesigner 
  468.          Caption         =   "Data &Form Designer..."
  469.          HelpContextID   =   2098108
  470.          Visible         =   0   'False
  471.       End
  472.       Begin VB.Menu mnuUReplace 
  473.          Caption         =   "&Global Replace..."
  474.          HelpContextID   =   2016091
  475.       End
  476.       Begin VB.Menu mnuUBar1 
  477.          Caption         =   "-"
  478.          Visible         =   0   'False
  479.       End
  480.       Begin VB.Menu mnuUAttachments 
  481.          Caption         =   "&Attachments.."
  482.          HelpContextID   =   2016086
  483.          Visible         =   0   'False
  484.       End
  485.       Begin VB.Menu mnuUGroupsUsers 
  486.          Caption         =   "&Groups/Users..."
  487.          HelpContextID   =   2016088
  488.          Visible         =   0   'False
  489.       End
  490.       Begin VB.Menu mnuUSystemDB 
  491.          Caption         =   "&SYSTEM.MD?..."
  492.          HelpContextID   =   2016090
  493.          Visible         =   0   'False
  494.       End
  495.       Begin VB.Menu mnuUBar2 
  496.          Caption         =   "-"
  497.       End
  498.       Begin VB.Menu mnuPref 
  499.          Caption         =   "&Preferences"
  500.          HelpContextID   =   2093354
  501.          Begin VB.Menu mnuPOpenOnStartup 
  502.             Caption         =   "&Open Last DataBase on Startup"
  503.          End
  504.          Begin VB.Menu mnuPAllowSys 
  505.             Caption         =   "&Include System Tables"
  506.          End
  507.          Begin VB.Menu mnuBar4 
  508.             Caption         =   "-"
  509.          End
  510.          Begin VB.Menu mnuPQueryTimeout 
  511.             Caption         =   "&Query Timeout Value..."
  512.          End
  513.          Begin VB.Menu mnuPLoginTimeout 
  514.             Caption         =   "&Login Timeout Value..."
  515.          End
  516.       End
  517.    End
  518.    Begin VB.Menu mnuWindow 
  519.       Caption         =   "&Window"
  520.       HelpContextID   =   2016100
  521.       WindowList      =   -1  'True
  522.       Begin VB.Menu mnuWTile 
  523.          Caption         =   "&Tile"
  524.       End
  525.       Begin VB.Menu mnuWCascade 
  526.          Caption         =   "&Cascade"
  527.       End
  528.       Begin VB.Menu mnuWArrange 
  529.          Caption         =   "&Arrange Icons"
  530.       End
  531.    End
  532.    Begin VB.Menu mnuHelp 
  533.       Caption         =   "&Help"
  534.       HelpContextID   =   2093307
  535.       Begin VB.Menu mnuHSearch 
  536.          Caption         =   "&Search..."
  537.       End
  538.       Begin VB.Menu mnuBar7 
  539.          Caption         =   "-"
  540.       End
  541.       Begin VB.Menu mnuHAbout 
  542.          Caption         =   "&About..."
  543.       End
  544.    End
  545.    Begin VB.Menu mnuDBPopUp 
  546.       Caption         =   ""
  547.       Visible         =   0   'False
  548.       Begin VB.Menu mnuDBPUOpen 
  549.          Caption         =   "&Open"
  550.       End
  551.       Begin VB.Menu mnuDBPUDesign 
  552.          Caption         =   "&Design..."
  553.       End
  554.       Begin VB.Menu mnuDBPUEdit 
  555.          Caption         =   "&Edit"
  556.       End
  557.       Begin VB.Menu mnuDBPURename 
  558.          Caption         =   "&Rename"
  559.       End
  560.       Begin VB.Menu mnuDBPUDelete 
  561.          Caption         =   "De&lete"
  562.       End
  563.       Begin VB.Menu mnuDBPUBar1 
  564.          Caption         =   "-"
  565.       End
  566.       Begin VB.Menu mnuDBPUCopyStruct 
  567.          Caption         =   "Copy Structure..."
  568.       End
  569.       Begin VB.Menu mnuDBPURemoveAll 
  570.          Caption         =   "Remove All Records"
  571.          Visible         =   0   'False
  572.       End
  573.       Begin VB.Menu mnuDBPURefresh 
  574.          Caption         =   "Refresh List"
  575.       End
  576.       Begin VB.Menu mnuDBPUBar2 
  577.          Caption         =   "-"
  578.       End
  579.       Begin VB.Menu mnuDBPUNewTable 
  580.          Caption         =   "New &Table"
  581.       End
  582.       Begin VB.Menu mnuDBPUNewQuery 
  583.          Caption         =   "New &Query"
  584.       End
  585.    End
  586. Attribute VB_Name = "frmMDI"
  587. Attribute VB_GlobalNameSpace = False
  588. Attribute VB_Creatable = False
  589. Attribute VB_PredeclaredId = True
  590. Attribute VB_Exposed = False
  591. Option Explicit
  592. Option Compare Binary
  593. '>>>>>>>>>>>>>>>>>>>>>>>>
  594. 'menus
  595. Const MNU_Database = "&File"
  596. Const MNU_DBOpen = "&Open DataBase..."
  597. Const MNU_DBOMDB = "&Microsoft Access..."
  598. Const MNU_DBOText = "&Text Files..."
  599. Const MNU_DBOODBC = "&ODBC..."
  600. Const MNU_DBNew = "&New..."
  601. Const MNU_DBNMDB = "&Microsoft Access"
  602. Const MNU_DBNMDB2x = "Version &2.0 MDB..."
  603. Const MNU_DBNMDB70 = "Version &7.0 MDB..."
  604. Const MNU_DBNODBC = "&ODBC..."
  605. Const MNU_DBNText = "&Text Files..."
  606. Const MNU_DBClose = "&Close"
  607. Const MNU_DBImpExp = "&Import/Export..."
  608. Const MNU_DBWorkspace = "&Workspace..."
  609. Const MNU_DBErrors = "&Errors..."
  610. Const MNU_DBCompact = "Co&mpact MDB..."
  611. Const MNU_DBRepair = "&Repair MDB..."
  612. Const MNU_DBExit = "E&xit"
  613. Const MNU_Util = "&Utility"
  614. Const MNU_UQuery = "&Query Builder..."
  615. Const MNU_UDataFormDesigner = "Data &Form Designer..."
  616. Const MNU_UReplace = "&Global Replace..."
  617. Const MNU_UAttachments = "&Attachments.."
  618. Const MNU_UGroupsUsers = "&Groups/Users..."
  619. Const MNU_USystemDB = "&SYSTEM.MD?..."
  620. Const MNU_Pref = "&Preferences"
  621. Const MNU_POpenOnStartup = "&Open Last DataBase on Startup"
  622. Const MNU_PAllowSys = "&Include System Tables"
  623. Const MNU_PQueryTimeout = "&Query Timeout Value..."
  624. Const MNU_PLoginTimeout = "&Login Timeout Value..."
  625. Const MNU_Window = "&Window"
  626. Const MNU_WTile = "&Tile"
  627. Const MNU_WCascade = "&Cascade"
  628. Const MNU_WArrange = "&Arrange Icons"
  629. Const MNU_Help = "&Help"
  630. Const MNU_HSearch = "&Search Reference Index..."
  631. Const MNU_HAbout = "&About..."
  632. Const MNU_DBPUOpen = "&Open"
  633. Const MNU_DBPUDesign = "&Design..."
  634. Const MNU_DBPUEdit = "&Edit"
  635. Const MNU_DBPURename = "&Rename"
  636. Const MNU_DBPUDelete = "De&lete"
  637. Const MNU_DBPUCopyStruct = "Copy Structure..."
  638. Const MNU_DBPURemoveAll = "Remove All Records"
  639. Const MNU_DBPURefresh = "Refresh List"
  640. Const MNU_DBPUNewTable = "New &Table"
  641. Const MNU_DBPUNewQuery = "New &Query"
  642. 'tooltips
  643. Const TOOLTIP1 = "Table type Recordset"
  644. Const TOOLTIP2 = "Dynaset type Recordset"
  645. Const TOOLTIP3 = "Snapshot type Recordset"
  646. Const TOOLTIP4 = "Passthrough type Recordset"
  647. Const TOOLTIP5 = "Use Data Control on New Form"
  648. Const TOOLTIP6 = "Don't Use Data Control on New Form"
  649. Const TOOLTIP7 = "Use DBGrid Control on New Form"
  650. Const TOOLTIP8 = "Begin a Transaction"
  651. Const TOOLTIP9 = "Rollback current Transaction"
  652. Const TOOLTIP10 = "Commit current Transaction"
  653. 'misc strings
  654. Const MSG3 = "Press any key to Close About Box"
  655. Const MSG4 = "Enter New Database Parameters"
  656. Const MSG5 = "Enter Driver Name from ODBCINST.INI File:"
  657. Const MSG6 = "Driver Name"
  658. Const MSG7 = "You must Close First!"
  659. Const MSG8 = "NOTE: Use of Attached Tables is the Recommended Method"
  660. Const MSG9 = "Microsoft Access MDBs (*.mdb)|*.mdb|All Files (*.*)|*.*"
  661. Const MSG10 = "Open Microsoft Access Database to Repair"
  662. Const MSG11 = "Repairing "
  663. Const MSG12 = "Open Repaired Database?"
  664. Const MSG13 = "System Databases|SYSTEM.MD?"
  665. Const MSG14 = "Select SYSTEM.MD? (Microsoft Access Security File)"
  666. Const MSG15 = " User: "
  667. Const MSG16 = "Current Database must be closed due to the error!"
  668. Const MSG17 = "No Users found, try 'Utility/System MD?'!"
  669. Const MSG18 = "Login Timeout (in seconds):"
  670. Const MSG19 = "No Database Open"
  671. Const MSG20 = "Query Timeout (in seconds):"
  672. Const MSG21 = "Delete Table?"
  673. Const MSG22 = "Delete QueryDef?"
  674. Const MSG23 = "Delete Field?"
  675. Const MSG24 = "Delete Index?"
  676. Const MSG25 = "Delete All Records in Table?"
  677. Const MSG26 = "Rows deleted: "
  678. Const MSG27 = "SYSTEM.MD? Not found, Add one to VB Settings?"
  679. Const MSG28 = "Transactions not supported by this Driver!"
  680. Const MSG29 = "All changes will be gone, Rollback anyway?"
  681. Const MSG30 = " Property is Read Only!"
  682. Const MSG31 = "This function requires an active project!"
  683. '>>>>>>>>>>>>>>>>>>>>>>>>
  684. Dim mHwnd As Long
  685. Private Sub mnuDBC70MDB_Click()
  686.   CompactDB dbVersion30
  687. End Sub
  688. Private Sub mnuDBNMDB2x_Click()
  689.   NewMDB dbVersion20
  690. End Sub
  691. Private Sub mnuDBNMDB70_Click()
  692.   NewMDB dbVersion30
  693. End Sub
  694. Private Sub mnuDBOExcel_Click()
  695.   'we can use Excel 5.0 for all Excel files because
  696.   'the ISAM will figure out the version when
  697.   'it opens file
  698.   gsDataType = gsEXCEL50
  699.   OpenLocalDB False
  700. End Sub
  701. Private Sub mnuDBPUDesign_Click()
  702.   On Error Resume Next
  703.   If gnodDBNode2 Is Nothing Then Exit Sub
  704.   If gnodDBNode2.Tag = TABLE_STR Then
  705.     gbAddTableFlag = False
  706.     Screen.MousePointer = vbHourglass
  707.     frmTblStruct.Show vbModal
  708.   ElseIf gnodDBNode2.Tag = QUERY_STR Then
  709.     Set frmDatabase.tvDatabase.SelectedItem = gnodDBNode2
  710.     frmSQL.txtSQLStatement.Text = gdbCurrentDB.QueryDefs(gnodDBNode2.Text).SQL
  711.   End If
  712. End Sub
  713. Sub mnuDBPUEdit_Click()
  714.   On Error GoTo mnuDBPUEdit_ClickErr
  715.   Dim prpObj As Property
  716.   Dim vTmp As Variant
  717.   Dim vNew As Variant
  718.   Dim frmProp As New frmProperty
  719.   If gnodDBNode2.Parent.Parent Is Nothing Then
  720.     'must be a database property
  721.     Set prpObj = gdbCurrentDB.Properties(VBA.Left(gnodDBNode2.Text, InStr(gnodDBNode2.Text, "=") - 1))
  722.   Else
  723.     Select Case gnodDBNode2.Parent.Parent.Tag
  724.       Case TABLE_STR
  725.         Set prpObj = gdbCurrentDB.TableDefs(gnodDBNode2.Parent.Parent.Text).Properties(VBA.Left(gnodDBNode2.Text, InStr(gnodDBNode2.Text, "=") - 1))
  726.       Case QUERY_STR
  727.         Set prpObj = gdbCurrentDB.QueryDefs(gnodDBNode2.Parent.Parent.Text).Properties(VBA.Left(gnodDBNode2.Text, InStr(gnodDBNode2.Text, "=") - 1))
  728.       Case FIELDS_STR
  729.         Set prpObj = gdbCurrentDB.TableDefs(gnodDBNode2.Parent.Parent.Parent.Text).Fields(gnodDBNode2.Parent.Text).Properties(VBA.Left(gnodDBNode2.Text, InStr(gnodDBNode2.Text, "=") - 1))
  730.       Case INDEXES_STR
  731.         Set prpObj = gdbCurrentDB.TableDefs(gnodDBNode2.Parent.Parent.Parent.Text).Indexes(gnodDBNode2.Parent.Text).Properties(VBA.Left(gnodDBNode2.Text, InStr(gnodDBNode2.Text, "=") - 1))
  732.       Case Else
  733.         Exit Sub
  734.     End Select
  735.   End If
  736.   'store the value
  737.   vTmp = prpObj.Value
  738.   On Error Resume Next
  739.   'try to set it to it's current value
  740.   'to see if it is readonly
  741.   prpObj.Value = vTmp
  742.   If Err Then
  743.     'readonly so just exit
  744.     Err.Clear
  745.     MsgBox "'" & prpObj.Name & "'" & MSG30, vbExclamation
  746.     Exit Sub
  747.   End If
  748.   On Error GoTo mnuDBPUEdit_ClickErr
  749.   With frmProp
  750.     Set .PropObject = prpObj
  751.     .Show vbModal
  752.     If .OK Then
  753.       gnodDBNode2.Text = prpObj.Name & "=" & prpObj.Value
  754.       'see if it was a Name property
  755.       If prpObj.Name = "Name" Then
  756.         gnodDBNode2.Parent.Text = prpObj.Value
  757.       End If
  758.     End If
  759.     Unload frmProp
  760.   End With
  761.   Set frmProp = Nothing
  762.   Exit Sub
  763. mnuDBPUEdit_ClickErr:
  764.   ShowError
  765. End Sub
  766. Private Sub mnuDBPUNewQuery_Click()
  767.   'load the query form to help build a query
  768.   Unload frmQuery      'just to clear things out
  769.   frmQuery.Show
  770. End Sub
  771. Private Sub mnuDBPUNewTable_Click()
  772.   gbAddTableFlag = True
  773.   Screen.MousePointer = vbHourglass
  774.   frmTblStruct.Show vbModal
  775. End Sub
  776. Sub mnuDBPUOpen_Click()
  777.   On Error Resume Next
  778.   gbFromSQL = False
  779.   Screen.MousePointer = vbHourglass
  780.   If gnodDBNode.Tag = TABLE_STR Then
  781.     OpenTable StripConnect(gnodDBNode2.Text)
  782.   ElseIf gnodDBNode.Tag = QUERY_STR Then
  783.     OpenQuery gnodDBNode2.Text, False
  784.   End If
  785.   Screen.MousePointer = vbDefault
  786.   MsgBar vbNullString, False
  787. End Sub
  788. Private Sub mnuHAbout_Click()
  789.   MsgBar MSG3, False
  790.   frmAboutBox.Show vbModal
  791.   MsgBar vbNullString, False
  792. End Sub
  793. Private Sub mnuDBC20MDB_Click()
  794.   CompactDB dbVersion20
  795. End Sub
  796. Private Sub mnuDBClose_Click()
  797.   CloseCurrentDB
  798. End Sub
  799. Private Sub mnuDBErrors_Click()
  800.   On Error Resume Next
  801.   Screen.MousePointer = vbHourglass
  802.   RefreshErrors
  803.   Screen.MousePointer = vbDefault
  804.   If Err Then ShowError
  805. End Sub
  806. Private Sub mnuDBExit_Click()
  807.   Unload Me
  808. End Sub
  809. Private Sub mnuDBNBtrieve_Click()
  810.    gsDataType = gsBTRIEVE
  811.    NewLocalISAM
  812. End Sub
  813. Private Sub mnuDBNDbase3_Click()
  814.    gsDataType = gsDBASEIII
  815.    NewLocalISAM
  816. End Sub
  817. Private Sub mnuDBNDbase4_Click()
  818.    gsDataType = gsDBASEIV
  819.    NewLocalISAM
  820. End Sub
  821. Private Sub mnuDBNDbase5_Click()
  822.    gsDataType = gsDBASE5
  823.    NewLocalISAM
  824. End Sub
  825. Private Sub mnuDBNFox20_Click()
  826.    gsDataType = gsFOXPRO20
  827.    NewLocalISAM
  828. End Sub
  829. Private Sub mnuDBNFox25_Click()
  830.    gsDataType = gsFOXPRO25
  831.    NewLocalISAM
  832. End Sub
  833. Private Sub mnuDBNFox26_Click()
  834.    gsDataType = gsFOXPRO26
  835.    NewLocalISAM
  836. End Sub
  837. Private Sub mnuDBNFox30_Click()
  838.    gsDataType = gsFOXPRO30
  839.    NewLocalISAM
  840. End Sub
  841. Private Sub mnuDBNODBC_Click()
  842.   On Error GoTo DBNErr
  843.   Dim sDriverName As String
  844.   MsgBar MSG4, False
  845.   'driver must be an valid entry in ODBCINST.INI
  846.   sDriverName = InputBox(MSG5, MSG6, gsDEFAULT_DRIVER)
  847.   If Len(sDriverName) = 0 Then Exit Sub 'they cancelled
  848.   DBEngine.RegisterDatabase vbNullString, sDriverName, False, vbNullString
  849.   SendKeys "%FOO"   'force open database dialog
  850.   MsgBar vbNullString, False
  851.   Exit Sub
  852. DBNErr:
  853.   ShowError
  854. End Sub
  855. Private Sub mnuDBNParadox3_Click()
  856.   gsDataType = gsPARADOX3X
  857.   NewLocalISAM
  858. End Sub
  859. Private Sub mnuDBNParadox4_Click()
  860.   gsDataType = gsPARADOX4X
  861.   NewLocalISAM
  862. End Sub
  863. Private Sub mnuDBNParadox5_Click()
  864.   gsDataType = gsPARADOX5X
  865.   NewLocalISAM
  866. End Sub
  867. Private Sub mnuDBNText_Click()
  868.   gsDataType = gsTEXTFILES
  869.   NewLocalISAM
  870. End Sub
  871. Private Sub mnuDBOMDB_Click()
  872.   gsDataType = gsMSACCESS
  873.   OpenLocalDB False
  874. End Sub
  875. Private Sub mnuDBOBtrieve_Click()
  876.   gsDataType = gsBTRIEVE
  877.   OpenLocalDB False
  878. End Sub
  879. Private Sub mnuDBODbase3_Click()
  880.    gsDataType = gsDBASEIII
  881.    OpenLocalDB False
  882. End Sub
  883. Private Sub mnuDBODbase4_Click()
  884.    gsDataType = gsDBASEIV
  885.    OpenLocalDB False
  886. End Sub
  887. Private Sub mnuDBODbase5_Click()
  888.    gsDataType = gsDBASE5
  889.    OpenLocalDB False
  890. End Sub
  891. Private Sub mnuDBOFox20_Click()
  892.    gsDataType = gsFOXPRO20
  893.    OpenLocalDB False
  894. End Sub
  895. Private Sub mnuDBOFox25_Click()
  896.    gsDataType = gsFOXPRO25
  897.    OpenLocalDB False
  898. End Sub
  899. Private Sub mnuDBOFox26_Click()
  900.    gsDataType = gsFOXPRO26
  901.    OpenLocalDB False
  902. End Sub
  903. Private Sub mnuDBOFox30_Click()
  904.    gsDataType = gsFOXPRO30
  905.    OpenLocalDB False
  906. End Sub
  907. Private Sub mnuDBOODBC_Click()
  908.   Dim frm As New frmODBCLogon
  909.   frm.Show vbModal
  910.   If frm.DBOpened Then
  911.     ShowDBTools
  912.     RefreshTables Nothing
  913.     MsgBar MSG8, False
  914.   End If
  915.   Unload frm
  916.   Set frm = Nothing
  917. End Sub
  918. Private Sub mnuDBOParadox3_Click()
  919.    gsDataType = gsPARADOX3X
  920.    OpenLocalDB False
  921. End Sub
  922. Private Sub mnuDBOParadox4_Click()
  923.    gsDataType = gsPARADOX4X
  924.    OpenLocalDB False
  925. End Sub
  926. Private Sub mnuDBOParadox5_Click()
  927.    gsDataType = gsPARADOX5X
  928.    OpenLocalDB False
  929. End Sub
  930. Private Sub mnuDBOText_Click()
  931.    gsDataType = gsTEXTFILES
  932.    OpenLocalDB False
  933. End Sub
  934. Private Sub mnuDBRepair_Click()
  935.   On Error GoTo RepairAccErr
  936.   Dim sNewName As String
  937.   'get file name to repair
  938.   With dlgCMD1
  939.     .Filter = MSG9
  940.     .DialogTitle = MSG10
  941.     .FilterIndex = 1
  942.     .Flags = FileOpenConstants.cdlOFNHideReadOnly
  943.     .ShowOpen
  944.   End With
  945.   If Len(dlgCMD1.FileName) > 0 Then
  946.     sNewName = dlgCMD1.FileName
  947.   Else
  948.     Exit Sub
  949.   End If
  950.   Screen.MousePointer = vbHourglass
  951.   MsgBar MSG11 & sNewName, True
  952.   DBEngine.RepairDatabase sNewName
  953.   Screen.MousePointer = vbDefault
  954.   MsgBar vbNullString, False
  955.   If MsgBox(MSG12, vbYesNo + vbQuestion) = vbYes Then
  956.     If gbDBOpenFlag Then
  957.       Call mnuDBClose_Click
  958.     End If
  959.     gsDataType = gsMSACCESS
  960.     gsDBName = sNewName
  961.     OpenLocalDB True
  962.   End If
  963.   If gbDBOpenFlag Then
  964.     ShowDBTools
  965.     RefreshTables Nothing
  966.   End If
  967.   Exit Sub
  968. RepairAccErr:
  969.   If Err <> 32755 Then
  970.     ShowError
  971.   End If
  972. End Sub
  973. Private Sub mnuHSearch_Click()
  974.   On Error Resume Next
  975.   Dim nRet As Integer
  976.   nRet = OSWinHelp(Me.hwnd, App.HelpFile, HelpConstants.cdlHelpPartialKey, 0)
  977.   If Err Then
  978.     ShowError
  979.   End If
  980. End Sub
  981. Private Sub mnuUSystemDB_Click()
  982.   On Error Resume Next
  983.   Dim sTmp As String
  984.   Dim x As Integer
  985.   With dlgCMD1
  986.     .Filter = MSG13
  987.     .DialogTitle = MSG14
  988.     .FilterIndex = 1
  989.     .FileName = "SYSTEM.MDW"
  990.     .CancelError = True
  991.     .Flags = FileOpenConstants.cdlOFNHideReadOnly + FileOpenConstants.cdlOFNFileMustExist
  992.   End With
  993.   On Error Resume Next
  994.   dlgCMD1.ShowOpen
  995.   If Err = 32755 Then         'user cancelled
  996.     Exit Sub
  997.   Else
  998.     sTmp = dlgCMD1.FileName  'must be a good filename
  999.     SaveSetting APP_CATEGORY & "\VisData", "Engines", "SystemDB", sTmp
  1000.     SaveSetting APP_CATEGORY, App.Title, "LoadSystemDB", "Yes"
  1001.   End If
  1002. End Sub
  1003. Private Sub mnuDBWorkspace_Click()
  1004.   On Error GoTo WSErr
  1005.   Dim sDBName As String
  1006.   Dim sConnect As String
  1007.   Dim sUser As String
  1008.   If gbDBOpenFlag Then
  1009.     'save the old settings
  1010.     sDBName = gdbCurrentDB.Name
  1011.     sConnect = gdbCurrentDB.Connect
  1012.     sUser = gwsMainWS.UserName
  1013.   End If
  1014.   frmLogin.Show vbModal
  1015.   stsStatusBar.Panels(2).Text = MSG15 & gwsMainWS.UserName & " "
  1016.   'reopen the database if the user changed
  1017.   If UCase(sUser) <> UCase(gwsMainWS.UserName) And gbDBOpenFlag Then
  1018.     'have to close objects that will be invalid after reopening the DB
  1019.     CloseAllRecordsets
  1020.     Set gdbCurrentDB = gwsMainWS.OpenDatabase(sDBName, False, gnReadOnly, sConnect)
  1021.   End If
  1022.   Exit Sub
  1023. WSErr:
  1024.   ShowError
  1025.   If gbDBOpenFlag Then
  1026.     MsgBox MSG16, 48
  1027.   End If
  1028.   Call mnuDBClose_Click
  1029. End Sub
  1030. Private Sub mnuUAttachments_Click()
  1031.   On Error Resume Next
  1032.   Screen.MousePointer = vbHourglass
  1033.   frmAttachments.Show
  1034.   Screen.MousePointer = vbDefault
  1035.   If Err Then ShowError
  1036. End Sub
  1037. Private Sub mnuUGroupsUsers_Click()
  1038.   On Error Resume Next
  1039.   If gwsMainWS.Users.Count = 0 Then
  1040.     Beep
  1041.     MsgBox MSG17, 48
  1042.     Exit Sub
  1043.   End If
  1044.   Screen.MousePointer = vbHourglass
  1045.   frmGroupsUsers.Show
  1046.   Screen.MousePointer = vbDefault
  1047.   If Err Then ShowError
  1048. End Sub
  1049. Private Sub mnuPAllowSys_Click()
  1050.   On Error Resume Next
  1051.   mnuPAllowSys.Checked = Not mnuPAllowSys.Checked
  1052.   If Not gbDBOpenFlag Then Exit Sub
  1053.   RefreshTables Nothing
  1054. End Sub
  1055. Private Sub mnuPLoginTimeout_Click()
  1056.   On Error GoTo LTErr
  1057.   Dim sNewValue As String
  1058.   sNewValue = InputBox(MSG18, , CStr(glLoginTimeout))
  1059.   If Len(sNewValue) = 0 Then Exit Sub
  1060.   'try to set the new value
  1061.   If Val(sNewValue) >= 0 Then
  1062.     glLoginTimeout = Val(sNewValue)
  1063.     DBEngine.LoginTimeout = glLoginTimeout
  1064.   End If
  1065.   Exit Sub
  1066. LTErr:
  1067.   ShowError
  1068. End Sub
  1069. Private Sub mnuPOpenOnStartup_Click()
  1070.   mnuPOpenOnStartup.Checked = Not mnuPOpenOnStartup.Checked
  1071. End Sub
  1072. Private Sub mnuPQueryTimeout_Click()
  1073.   On Error GoTo QTErr
  1074.   Dim sNewValue As String
  1075.   If Not gbDBOpenFlag Then MsgBox MSG19, 48: Exit Sub
  1076.   sNewValue = InputBox(MSG20, , CStr(gdbCurrentDB.QueryTimeout))
  1077.   If Len(sNewValue) = 0 Then Exit Sub
  1078.   'try to set the new value
  1079.   gdbCurrentDB.QueryTimeout = Val(sNewValue)
  1080.   glQueryTimeout = Val(sNewValue)
  1081.   Exit Sub
  1082. QTErr:
  1083.   ShowError
  1084.   'reset the form control after the error
  1085.   glQueryTimeout = gdbCurrentDB.QueryTimeout
  1086. End Sub
  1087. Private Sub mnuUDataFormDesigner_Click()
  1088.   On Error Resume Next
  1089.   'make sure a project is loaded
  1090.   If gVDClass.VBInstance.ActiveVBProject Is Nothing Then
  1091.     MsgBox MSG31, vbInformation
  1092.     Exit Sub
  1093.   End If
  1094.   frmDFD.Show vbModal
  1095.   If Err Then ShowError
  1096. End Sub
  1097. Private Sub mnuUQuery_Click()
  1098.   frmQuery.Show
  1099.   frmQuery.WindowState = 0
  1100. End Sub
  1101. Private Sub mnuDBPUCopyStruct_Click()
  1102.   On Error Resume Next
  1103.   frmCopyStruct.Show vbModal
  1104.   If Err Then ShowError
  1105. End Sub
  1106. Private Sub mnuDBPUDelete_Click()
  1107.   On Error GoTo TblDelErr
  1108.   Dim sName As String
  1109.   If gnodDBNode2 Is Nothing Then Exit Sub
  1110.   Select Case gnodDBNode2.Tag
  1111.     Case TABLE_STR
  1112.       sName = StripConnect(gnodDBNode2.Text)
  1113.       If MsgBox(MSG21, vbYesNo + vbQuestion) = vbYes Then
  1114.         gdbCurrentDB.TableDefs.Delete sName
  1115.         frmDatabase.tvDatabase.Nodes.Remove gnodDBNode2.Index
  1116.       End If
  1117.     Case QUERY_STR
  1118.       sName = gnodDBNode2.Text
  1119.       If MsgBox(MSG22, vbYesNo + vbQuestion) = vbYes Then
  1120.         gdbCurrentDB.QueryDefs.Delete sName
  1121.         frmDatabase.tvDatabase.Nodes.Remove gnodDBNode2.Index
  1122.       End If
  1123.     Case FIELD_STR
  1124.       sName = gnodDBNode2.Text
  1125.       If MsgBox(MSG23, vbYesNo + vbQuestion) = vbYes Then
  1126.         gdbCurrentDB.TableDefs(gnodDBNode2.Parent.Parent.Text).Fields.Delete sName
  1127.         frmDatabase.tvDatabase.Nodes.Remove gnodDBNode2.Index
  1128.       End If
  1129.     Case INDEX_STR
  1130.       sName = gnodDBNode2.Text
  1131.       If MsgBox(MSG24, vbYesNo + vbQuestion) = vbYes Then
  1132.         gdbCurrentDB.TableDefs(gnodDBNode2.Parent.Parent.Text).Indexes.Delete sName
  1133.         frmDatabase.tvDatabase.Nodes.Remove gnodDBNode2.Index
  1134.       End If
  1135.   End Select
  1136.   Exit Sub
  1137. TblDelErr:
  1138.   ShowError
  1139. End Sub
  1140. Private Sub mnuDBPURefresh_Click()
  1141.   gdbCurrentDB.TableDefs.Refresh
  1142.   RefreshTables Nothing
  1143. End Sub
  1144. Private Sub mnuDBPURename_Click()
  1145.   On Error GoTo mnuDBPURename_ClickErr
  1146.   If Not gnodDBNode2 Is Nothing Then
  1147.     'set it to the new node for editing
  1148.     Set frmDatabase.tvDatabase.SelectedItem = gnodDBNode2
  1149.     frmDatabase.tvDatabase.StartLabelEdit
  1150.   End If
  1151.   Exit Sub
  1152. mnuDBPURename_ClickErr:
  1153.   ShowError
  1154. End Sub
  1155. Private Sub mnuDBPURemoveAll_Click()
  1156.   On Error GoTo RemoveAllErr
  1157.   Dim sTBLName As String
  1158.   sTBLName = StripConnect(gnodDBNode.Text)
  1159.   If MsgBox(MSG25 & " '" & sTBLName & "'", vbYesNo + vbQuestion) = vbYes Then
  1160.     'delete all rows with a sql statement
  1161.     If gsDataType = gsSQLDB Then
  1162.       gdbCurrentDB.Execute ("delete from " & sTBLName), dbSQLPassThrough
  1163.     Else
  1164.       gdbCurrentDB.Execute ("delete from " & sTBLName)
  1165.     End If
  1166.     If gdbCurrentDB.RecordsAffected > 0 Then
  1167.       MsgBox MSG26 & gdbCurrentDB.RecordsAffected, 48
  1168.       If gbTransPending Then gbDBChanged = True
  1169.     End If
  1170.   End If
  1171.   Exit Sub
  1172. RemoveAllErr:
  1173.   If Err = gnEOF_ERR Then Resume Next
  1174.   ShowError
  1175. End Sub
  1176. Private Sub mnuDBImpExp_Click()
  1177.   On Error Resume Next
  1178.   frmImpExp.Show vbModal
  1179.   If Err Then ShowError
  1180. End Sub
  1181. Private Sub mnuUReplace_Click()
  1182.   On Error GoTo ReplaceErr
  1183.   frmReplace.Show vbModal
  1184.   Exit Sub
  1185. ReplaceErr:
  1186.   ShowError
  1187. End Sub
  1188. Private Sub mnuWArrange_Click()
  1189.   Me.Arrange 3
  1190. End Sub
  1191. Private Sub mnuWCascade_Click()
  1192.   Me.Arrange 0
  1193. End Sub
  1194. Private Sub mnuWTile_Click()
  1195.   Me.Arrange 2
  1196. End Sub
  1197. Private Sub MDIForm_Load()
  1198.   On Error GoTo MDILErr
  1199.   Dim x As Integer
  1200.   'load strings from constants
  1201.   'menus
  1202.   mnuDatabase.Caption = MNU_Database
  1203.   mnuDBOpen.Caption = MNU_DBOpen
  1204.   mnuDBOMDB.Caption = MNU_DBOMDB
  1205.   mnuDBOText.Caption = MNU_DBOText
  1206.   mnuDBOODBC.Caption = MNU_DBOODBC
  1207.   mnuDBNew.Caption = MNU_DBNew
  1208.   mnuDBNMDB.Caption = MNU_DBNMDB
  1209.   mnuDBNMDB2x.Caption = MNU_DBNMDB2x
  1210.   mnuDBNMDB70.Caption = MNU_DBNMDB70
  1211.   mnuDBNODBC.Caption = MNU_DBNODBC
  1212.   mnuDBNText.Caption = MNU_DBNText
  1213.   mnuDBClose.Caption = MNU_DBClose
  1214.   mnuDBImpExp.Caption = MNU_DBImpExp
  1215.   mnuDBWorkspace.Caption = MNU_DBWorkspace
  1216.   mnuDBErrors.Caption = MNU_DBErrors
  1217.   mnuDBCompact.Caption = MNU_DBCompact
  1218.   mnuDBRepair.Caption = MNU_DBRepair
  1219.   mnuDBExit.Caption = MNU_DBExit
  1220.   mnuUtil.Caption = MNU_Util
  1221.   mnuUQuery.Caption = MNU_UQuery
  1222.   mnuUDataFormDesigner.Caption = MNU_UDataFormDesigner
  1223.   mnuUReplace.Caption = MNU_UReplace
  1224.   mnuUAttachments.Caption = MNU_UAttachments
  1225.   mnuUGroupsUsers.Caption = MNU_UGroupsUsers
  1226.   mnuUSystemDB.Caption = MNU_USystemDB
  1227.   mnuPref.Caption = MNU_Pref
  1228.   mnuPOpenOnStartup.Caption = MNU_POpenOnStartup
  1229.   mnuPAllowSys.Caption = MNU_PAllowSys
  1230.   mnuPQueryTimeout.Caption = MNU_PQueryTimeout
  1231.   mnuPLoginTimeout.Caption = MNU_PLoginTimeout
  1232.   mnuWindow.Caption = MNU_Window
  1233.   mnuWTile.Caption = MNU_WTile
  1234.   mnuWCascade.Caption = MNU_WCascade
  1235.   mnuWArrange.Caption = MNU_WArrange
  1236.   mnuHelp.Caption = MNU_Help
  1237.   mnuHSearch.Caption = MNU_HSearch
  1238.   mnuHAbout.Caption = MNU_HAbout
  1239.   mnuDBPUOpen.Caption = MNU_DBPUOpen
  1240.   mnuDBPUDesign.Caption = MNU_DBPUDesign
  1241.   mnuDBPUEdit.Caption = MNU_DBPUEdit
  1242.   mnuDBPURename.Caption = MNU_DBPURename
  1243.   mnuDBPUDelete.Caption = MNU_DBPUDelete
  1244.   mnuDBPUCopyStruct.Caption = MNU_DBPUCopyStruct
  1245.   mnuDBPURemoveAll.Caption = MNU_DBPURemoveAll
  1246.   mnuDBPURefresh.Caption = MNU_DBPURefresh
  1247.   mnuDBPUNewTable.Caption = MNU_DBPUNewTable
  1248.   mnuDBPUNewQuery.Caption = MNU_DBPUNewQuery
  1249.   'tooltips
  1250.   tlbToolBar.Buttons(1).ToolTipText = TOOLTIP1
  1251.   tlbToolBar.Buttons(2).ToolTipText = TOOLTIP2
  1252.   tlbToolBar.Buttons(3).ToolTipText = TOOLTIP3
  1253.   tlbToolBar.Buttons(4).ToolTipText = TOOLTIP4
  1254.   tlbToolBar.Buttons(6).ToolTipText = TOOLTIP5
  1255.   tlbToolBar.Buttons(7).ToolTipText = TOOLTIP6
  1256.   tlbToolBar.Buttons(8).ToolTipText = TOOLTIP7
  1257.   tlbToolBar.Buttons(10).ToolTipText = TOOLTIP8
  1258.   tlbToolBar.Buttons(11).ToolTipText = TOOLTIP9
  1259.   tlbToolBar.Buttons(12).ToolTipText = TOOLTIP10
  1260.   gnMULocking = True   'pessimistic locking by default
  1261.   App.HelpFile = App.Path & "\HELP\VB5.HLP"
  1262.   'need to disable Btrieve menu items under 32 bit
  1263.   mnuDBOBtrieve.Visible = False
  1264.   mnuDBNBtrieve.Visible = False
  1265.   'get form coordinates
  1266.   x = Val(GetINIString("WindowState", "2"))
  1267.   If x <> 1 Then
  1268.     frmMDI.WindowState = x
  1269.   Else
  1270.     frmMDI.WindowState = 0
  1271.   End If
  1272.   If frmMDI.WindowState = 0 Then
  1273.     frmMDI.Left = Val(GetINIString("WindowLeft", "0"))
  1274.     frmMDI.Top = Val(GetINIString("WindowTop", "0"))
  1275.     frmMDI.Width = Val(GetINIString("WindowWidth", "9135"))
  1276.     frmMDI.Height = Val(GetINIString("WindowHeight", "6900"))
  1277.   End If
  1278.   'see if the user previously said no to adding system.mda
  1279.   If Len(GetINIString("LoadSystemDB", vbNullString)) = 0 Then
  1280.     '1st time so prompt to add it if it is not present
  1281.     If MsgBox("Add SYSTEM.MD? (Microsoft Access Security File) to INI File?", vbYesNo + vbQuestion) = vbYes Then
  1282.       mnuUSystemDB_Click
  1283.     Else
  1284.       'store info so we don't keep asking
  1285.       SaveSetting APP_CATEGORY, App.Title, "LoadSystemDB", "No"
  1286.     End If
  1287.   End If
  1288.   On Error GoTo MDILErr
  1289.   'setup the DBEngine
  1290.   DBEngine.IniPath = "HKEY_CURRENT_USER\Software\VB and VBA Program Settings\" & APP_CATEGORY & "\" & App.Title
  1291.   DBEngine.DefaultUser = "admin"
  1292.   DBEngine.DefaultPassword = vbNullString
  1293.   'login to Jet
  1294.   On Error Resume Next
  1295.   Set gwsMainWS = DBEngine.CreateWorkspace("MainWS", "admin", vbNullString)
  1296.   If Err = 3029 Then
  1297.     frmLogin.Show vbModal
  1298.   ElseIf Err = 3044 Then  'invalid path so system.mda is bogus
  1299.     If MsgBox(MSG27, vbYesNo + vbQuestion) = vbYes Then
  1300.       mnuUSystemDB_Click
  1301.     Else
  1302.       'store info so we don't keep asking
  1303.       SaveSetting APP_CATEGORY, App.Title, "LoadSystemDB", "No"
  1304.       SaveSetting "VisData", "Options", "SystemDB", vbNullString
  1305.     End If
  1306.   ElseIf Err <> 0 Then
  1307.     ShowError
  1308.   End If
  1309.   stsStatusBar.Panels(2).Text = MSG15 & gwsMainWS.UserName & " "
  1310.   On Error GoTo MDILErr
  1311.   'add the workspace to the collection to bump the count
  1312.   Workspaces.Append gwsMainWS
  1313.   Me.Show
  1314.   LoadINISettings
  1315.   'attempt to open the last database if that option
  1316.   'has been set on the preferences menu
  1317.   If frmMDI.mnuPOpenOnStartup.Checked And Len(gsDBName) > 0 Then
  1318.     If gsDataType = gsSQLDB Then
  1319. '      'for an ODBC database, we need to
  1320. '      'sendkeys to open the ODBC dialog
  1321. '      SendKeys "%FOO{Enter}"
  1322.       mnuDBOODBC_Click
  1323.     Else
  1324.       OpenLocalDB True
  1325.     End If
  1326.   Else
  1327.     HideDBTools
  1328.   End If
  1329.   Exit Sub
  1330. MDILErr:
  1331.   ShowError
  1332. End Sub
  1333. Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  1334.   On Error Resume Next
  1335.   ShutDownVisData
  1336.   If mHwnd <> 0 Then
  1337.     'needed when VisData was loaded from the AddIn menu in VB
  1338.     mHwnd = SetWindowLong(Me.hwnd, -8, GetDesktopWindow())
  1339.   End If
  1340. End Sub
  1341. Private Sub mnuDBMRU_Click(Index As Integer)
  1342.   On Error GoTo MRUErr
  1343.   gsDBName = Mid(mnuDBMRU(Index).Caption, 4, Len(mnuDBMRU(Index).Caption))
  1344.   gsDataType = mnuDBMRU(Index).Tag
  1345.   If UCase(Left(gsDataType, 5)) <> gsSQLDB Then
  1346.     OpenLocalDB True
  1347.   Else
  1348.     'must be an ODBC database so we need to load frmOpenDB
  1349.     'this will get the connect parts
  1350.     GetODBCConnectParts gsDataType
  1351.     'call the routine that will load the form
  1352.     mnuDBOODBC_Click
  1353.   End If
  1354.   Exit Sub
  1355. MRUErr:
  1356.   ShowError
  1357. End Sub
  1358. Private Sub tlbToolBar_ButtonClick(ByVal BUTTON As BUTTON)
  1359.   On Error GoTo tlbToolBar_ButtonClickErr
  1360.   Select Case BUTTON.Key
  1361.     Case "DataControl"
  1362.       gnFormType = gnFORM_DATACTL
  1363.     Case "NoDataControl"
  1364.       gnFormType = gnFORM_NODATACTL
  1365.     Case "DBGrid"
  1366.       gnFormType = gnFORM_DATAGRID
  1367.     Case "Table"
  1368.       gnRSType = gnRS_TABLE
  1369.     Case "Dynaset"
  1370.       gnRSType = gnRS_DYNASET
  1371.     Case "Snapshot"
  1372.       gnRSType = gnRS_SNAPSHOT
  1373.     Case "PassThrough"
  1374.       gnRSType = gnRS_PASSTHRU
  1375.     Case "BeginTrans"
  1376.       If gdbCurrentDB.Transactions = False Then
  1377.         Beep
  1378.         MsgBox MSG28
  1379.         Exit Sub
  1380.       End If
  1381.       gwsMainWS.BeginTrans
  1382.       gbDBChanged = False
  1383.       gbTransPending = True
  1384.       tlbToolBar.Buttons("BeginTrans").Enabled = False
  1385.       tlbToolBar.Buttons("Commit").Enabled = True
  1386.       tlbToolBar.Buttons("Rollback").Enabled = True
  1387.     Case "Rollback"
  1388.       If MsgBox(MSG29, vbYesNo + vbQuestion) = vbYes Then
  1389.         gwsMainWS.Rollback
  1390.         gbDBChanged = False
  1391.         gbTransPending = False
  1392.         tlbToolBar.Buttons("BeginTrans").Enabled = True
  1393.         tlbToolBar.Buttons("Commit").Enabled = False
  1394.         tlbToolBar.Buttons("Rollback").Enabled = False
  1395.       End If
  1396.     Case "Commit"
  1397.       gwsMainWS.CommitTrans
  1398.       gbDBChanged = False
  1399.       gbTransPending = False
  1400.       tlbToolBar.Buttons("BeginTrans").Enabled = True
  1401.       tlbToolBar.Buttons("Commit").Enabled = False
  1402.       tlbToolBar.Buttons("Rollback").Enabled = False
  1403.   End Select
  1404.   Exit Sub
  1405. tlbToolBar_ButtonClickErr:
  1406.   ShowError
  1407. End Sub
  1408. Public Sub SetWindowParent()
  1409.   'needed when VisData is loaded from the AddIn menu in VB
  1410.   mHwnd = SetWindowLong(Me.hwnd, -8, gVDClass.VBInstance.MainWindow.hwnd)
  1411. End Sub
  1412.